package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.OfficeBuildingSaleMapper;
import com.ruoyi.business.domain.OfficeBuildingSale;
import com.ruoyi.business.service.IOfficeBuildingSaleService;

/**
 * 写字楼出售Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-12
 */
@Service
public class OfficeBuildingSaleServiceImpl implements IOfficeBuildingSaleService 
{
    @Autowired
    private OfficeBuildingSaleMapper officeBuildingSaleMapper;

    /**
     * 查询写字楼出售
     * 
     * @param id 写字楼出售主键
     * @return 写字楼出售
     */
    @Override
    public OfficeBuildingSale selectOfficeBuildingSaleById(Long id)
    {
        return officeBuildingSaleMapper.selectOfficeBuildingSaleById(id);
    }

    /**
     * 查询写字楼出售列表
     * 
     * @param officeBuildingSale 写字楼出售
     * @return 写字楼出售
     */
    @Override
    public List<OfficeBuildingSale> selectOfficeBuildingSaleList(OfficeBuildingSale officeBuildingSale)
    {
        return officeBuildingSaleMapper.selectOfficeBuildingSaleList(officeBuildingSale);
    }

    /**
     * 新增写字楼出售
     * 
     * @param officeBuildingSale 写字楼出售
     * @return 结果
     */
    @Override
    public int insertOfficeBuildingSale(OfficeBuildingSale officeBuildingSale)
    {
        officeBuildingSale.setCreateTime(DateUtils.getNowDate());
        return officeBuildingSaleMapper.insertOfficeBuildingSale(officeBuildingSale);
    }

    /**
     * 修改写字楼出售
     * 
     * @param officeBuildingSale 写字楼出售
     * @return 结果
     */
    @Override
    public int updateOfficeBuildingSale(OfficeBuildingSale officeBuildingSale)
    {
        officeBuildingSale.setUpdateTime(DateUtils.getNowDate());
        return officeBuildingSaleMapper.updateOfficeBuildingSale(officeBuildingSale);
    }

    /**
     * 批量删除写字楼出售
     * 
     * @param ids 需要删除的写字楼出售主键
     * @return 结果
     */
    @Override
    public int deleteOfficeBuildingSaleByIds(Long[] ids)
    {
        return officeBuildingSaleMapper.deleteOfficeBuildingSaleByIds(ids);
    }

    /**
     * 删除写字楼出售信息
     * 
     * @param id 写字楼出售主键
     * @return 结果
     */
    @Override
    public int deleteOfficeBuildingSaleById(Long id)
    {
        return officeBuildingSaleMapper.deleteOfficeBuildingSaleById(id);
    }
}
